import { ObjectType, transferTimestampToSecond } from '../../utils';
import { modifyType as modifyTypes, communicationDisplayStatus } from '@/const/risk';

export const columns: ObjectType[] = [
  {
    title: '账户名',
    dataIndex: 'username',
    key: 'username',
    width: 150,
  },
  {
    title: '记录类型',
    dataIndex: 'modifyType',
    key: 'modifyType',
    width: 100,
    render: (text: string, record: ObjectType) => {
      const { modifyType } = record;
      return modifyTypes.filter((val: ObjectType) => val.id === modifyType)[0].text;
    },
  },
  {
    title: '手机号/邮箱',
    dataIndex: 'modifyContent',
    key: 'modifyContent',
    width: 200,
  },
  {
    title: '状态',
    dataIndex: 'status',
    key: 'status',
    width: 150,
    render: (text: string, record: ObjectType) => {
      const { status } = record;
      return communicationDisplayStatus.filter((val: ObjectType) => val.id === status)[0].text;
    },
  },
  {
    title: '变更时间',
    dataIndex: 'modifyTime',
    key: 'modifyTime',
    width: 250,
    render: (text: number) => transferTimestampToSecond(text),
  },
];
